home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-08-09 | 2.8 KB | 126 lines | [TEXT/MPS ] |
- ### File RezC.BNDL
- ### W. Powell 1988
- ### Command file to generate a bundle resource
- ### Uses commando interface
-
- Set Exit 0
- Set rtyp 'BNDL'
- If {#} < 3
- Echo "### {0} Error: Bad arguments, use commando">>Dev:StdErr
- Exit 1
- End
- # BNDL resource ID
- Set rid {1}
- Shift 1
- # Get optional resource name
- If "{1}" == "-nms"
- Set rname "{2}"
- Shift 2
- End
- # Get signature stuff
- Set sig "{1}"
- Set sigID {2}
- Shift 2
- # Option to generate a signature resource as a 'STR '
- If "{1}" == "-autogr"
- # Create the signature resource
- Echo "∂nType ∂'{sig}∂' As ∂'STR ∂' ; "
- Echo "Resource ∂'{sig}∂' ({sigID}) ∂{"
- Echo "∂t∂"{2}∂""
- Echo "∂t∂};"
- Shift 2
- End
- Echo -n "∂nResource ∂'{rtyp}∂' ({rid}"
- If ( "{rname}" != "" )
- Echo -n ,∂""{rname}"∂"
- End
- If ( "{1}" == "-sy" ) ; Echo -n ",SysHeap" ; Shift ; End
- If ( "{1}" == "-pu" ) ; Echo -n ",Purgeable" ; Shift ; End
- If ( "{1}" == "-lo" ) ; Echo -n ",Locked" ; Shift ; End
- If ( "{1}" == "-Pr" ) ; Echo -n ",Protected" ; Shift ; End
- If ( "{1}" == "-PL" ) ; Echo -n ",PreLoad" ; Shift ; End
- Echo ") ∂{"
-
- # Get bundle Resource attributes
- Set LoopDone 0
- Set BndlCnt 1
- Set TypeCnt 0
- Set TypeList ""
- Set AFile `NewTempFile -q`
- WindToRear
- Loop # to Get all bundled resources
- Set ArgList ""
- Set ArgList "`RezC.BNDL.more…`"
- If "{ArgList}" == ""
- Set LoopDone 1
- End
- For Arg In `Quote {ArgList}`
- If {BndlCnt} == 1
- # Get Type of next Bundled resource
- Break If "{Arg}" == "-DONE"
- Break If "{Arg}" == ""
- Set rtyp "{Arg}"
- Set BndlCnt `Evaluate {BndlCnt} + 1`
- Continue
- Else If {BndlCnt} == 2
- # Get Local ID of resource
- Set LID {Arg}
- Set BndlCnt `Evaluate {BndlCnt} + 1`
- Continue
- Else If {BndlCnt} == 3
- # Get Actual Resource ID of bundled resource
- Set rid {Arg}
- Set BndlCnt 1
- End
- # Have one bundled resource at this point
- Set NewType 1
- Set OldType 0
- For TheType In `Quote {TypeList}`
- Set OldType `Evaluate {OldType} + 1`
- If "{TheType}" == "{rtyp}"
- Set NewType 0
- Break
- End
- End
- If {NewType} != 0
- Set TypeCnt `Evaluate {TypeCnt} + 1 `
- Set TypeList "`Quote {TypeList} "{rtyp}"`"
- Set Bndl{TypeCnt} "{LID},{rid}"
- Else If 0 == 0
- Clear •:∞ "{AFile}"
- Echo "Quote ∂{Bndl{OldType}∂}" >"{AFile}"
- Set Bndl{OldType} "`Execute "{AFile}"` {LID},{rid}"
- End
- End # For
- If "{Arg}" == "-DONE"
- Set LoopDone 1
- End
- Break If {LoopDone}
- End
- # Write the Rez text
- Echo "∂'{sig}∂',∂t∂/* Signature *∂/"
- Echo "{sigID},∂t∂t∂/* Signature version *∂/"
- Echo ∂{
- Set TypeCnt 0
- Set Flag 0
- For theType In `Quote {TypeList}`
- Set TypeCnt `Evaluate {TypeCnt} + 1`
- If {Flag}
- Echo ";"
- End
- Set Flag 1
- Echo "∂'{theType}∂',∂t∂/* Resource type *∂/∂n∂t∂{"
- Set LocCnt 0
- Echo "Quote ∂{Bndl{TypeCnt}∂}" >"{AFile}"
- For Item In `Execute "{AFile}"`
- If {LocCnt} != 0
- Echo ","
- End
- Set LocCnt 1
- Echo -n ∂t"{Item}"
- End
- Echo -n " }"
- End
- Echo "∂n∂} ∂};∂n"
- Close -n "{AFile}"
- Exit 0